package month3.day28;

public class Cat {
    private String name;
    private int weight;
    private int physical;

    public Cat(String name, int weight, int physical) {
        this.name = name;
        this.weight = weight;
        this.physical = physical;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public int getPhysical() {
        return physical;
    }

    public void setPhysical(int physical) {
        this.physical = physical;
    }
    public void show(){
        System.out.println("这个猫叫："+name+"体力："+physical);
    }
    public void zhualaoshu(String name, int physical){
        show();
        Mouse m=new Mouse(name,physical);
        m.show();
        System.out.println("老鼠被猫抓住,被咬死");
        setPhysical(this.physical+=10);
        m.setPhysical(0);
        System.out.println("猫体力"+this.physical+"老鼠体力"+m.getPhysical());
    }
}
